package edu.manchester.biology.eqhei.testing;



import edu.manchester.biology.eqhei.implementations.eQHEI_EvaluationIMP;
import edu.manchester.biology.eqhei.implementations.eQHEI_SectionIMP;
import edu.manchester.biology.eqhei.interfaces.eQHEI_Evaluation;
import edu.manchester.biology.eqhei.interfaces.eQHEI_Section;


/*
 * To change this license header, choose License Headers in Project Properties.
 * To change this template file, choose Tools | Templates
 * and open the template in the editor.
 */

/**
 *
 * @author mekendall
 */
public class MainTestingEvaluation {
    public static void main(String[] args) throws Exception{
        eQHEI_Evaluation e = new eQHEI_EvaluationIMP();
        eQHEI_Section s = new eQHEI_SectionIMP();
        addSection(e);
        printSection(e);
        
        try{
           while(true){
            eQHEI_Section a = e.next();
            System.out.println(a.getName() );
            } 
        }
        catch(Exception ex){
            System.out.println(ex.getMessage());
        }
        
        try{
           while(true){
            eQHEI_Section a =e.previous();
            System.out.println(a.getName() );
            } 
        }
        catch(Exception ex){
            System.out.println(ex.getMessage());
        }
        
        try{
           while(true){
            eQHEI_Section a = e.next();
            System.out.println(a.getName() );
            } 
        }
        catch(Exception ex){
            System.out.println(ex.getMessage());
        }
    }
    
    static void addSection(eQHEI_Evaluation e){
        String names[] = {"hello", "my", "name","is","eQHEI"};
        for(int i = 0; i < names.length; i++){
            eQHEI_Section s = new eQHEI_SectionIMP(names[i] + Integer.toString(i));
            e.add(s);
        }
    }
    
    static void printSection(eQHEI_Evaluation e) throws Exception{
        for(int i = 0; i < e.length(); i ++){
            eQHEI_Section sec =  e.get(i);
            System.out.println(sec.getName());
        }
    }
}
